<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/ui/ui.core.js"></script>
<script src="js/jquery-validate/jquery.validate.js" type="text/javascript"></script>
<script src="js/jquery-validate/additional-methods.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$.validator.setDefaults({
	submitHandler: function() { 
	$.post('sql_usuarios.php', $("#usuForm").serialize(),function(data)
 			{
				$('#').html(data);			
			});			
		    $("#usuForm")[0].reset();
		return false;
	}, 
	highlight: function(input) {
		$(input).addClass("resultadoBad");
	},
	unhighlight: function(input) {
		$(input).removeClass("resultadoBad");
	}});

	// validate formulario de inserción
	$("#usuForm").validate({
		rules: {
			login: {
				required: true,
				minlength: 7,
				digits: true
			},
			clave: {
				required: true,
				minlength: 8,
				},
			tipo: {
				required: true
			},
		},
	});
});
</script>
</head>

<body>
<form action="" method="" name="usuForm" id="usuForm">
     <table width="515" align="center" style="text-align:center">
     	<tr>
            <td width="124"><label for="login" class="label" style=" padding:0px;">Nombre de Usuario:</label></td>
            <td width="288" align="left"><input type="text" id="login" name="login" class="input req-numeric req-min2" minlength="7" maxlength="8" value="" /></td>
        </tr>
        <tr>
            <td><label for="clave" class="label">Clave de Usuario:</label></td>
            <td align="left"><input name="clave" id="clave" type="password" class="input req-min" minlength="3" maxlength="40" value="" /></td>
        </tr>
        <tr>
        <td><label for="tipo" class="label">Tipo de Usuario:</label></td>
        <td align="left"><select name="tipo" class="input-select req-option" id="tipo" minlength="1" style="height:25px;">
            <option value="" selected="selected">Seleccione</option>           
            <option value="2">Operador</option>
            <option value="1">Administrador</option>
        </select>
        </td>
        </tr>
        <tr>
        	<td><input type="hidden" name="MM_insert" value="usuForm"></td>
            <td>
  <!--          	<a href="#">
  <div id="crearUsuario" class="botonCustom" style="float:right;height:20px;width:100px;font-size:12px;margin-left:10px;">Crear</div> 
</a>-->
<input type="submit" id="crearUsuario" class="botonCustom" value="Crear" style="float:right;height:20px;width:100px;font-size:12px;margin-left:10px;" />
            </td>
        </tr>
    </table>
</form>
</body>
</html>
